#ifndef _P2P_FILE_H_
#define _P2P_FILE_H_

#define FILE_ "cya.zip"
#define HASH_FILE "cya.zip.hash"
#define META_FILE "cya.zip.meta"
#define FILE_SIZE 90269814

int read_file(const char *file_path, int start_pos, char **buffer, int length);
int generate_hash_file(const char *file_path);
int write_file(const char *file_path, int start_pos, const char *buffer, int length, int flags);
int verify_piece_integrity(const char *file, const char *hash_file, uint32_t index, int no_of_pieces);
int compute_hash(const char *buffer, int size, char *hash);

#endif // ifndef _P2P_FILE_H_ 
